uniform float width;
uniform float height;
uniform sampler2DRect crowdPosTexture;

varying vec3 eyeNormal;
varying vec3 eyePosition;

void main(void)
{ 

	float x = floor(mod(gl_InstanceID, width));
	float y = floor(gl_InstanceID / width);

	vec4 position = texture2DRect(crowdPosTexture, vec2(x, y));
	
	vec4 pos = vec4(gl_Vertex.xyz + position.xyz, 1.0); 
       
    gl_Position = gl_ModelViewProjectionMatrix * pos;
	
	
	// lightning
	eyeNormal = gl_NormalMatrix * gl_Normal;
	eyePosition = vec3(0,0,10);
	
}